home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / mf.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  7.7 KB  |  183 lines

  1. " Vim syntax file
  2. " Language   : Metafont
  3. " Maintainer : Andreas Scherer <andreas.scherer@pobox.com>
  4. " Last change: April 26, 1998
  5.  
  6. " Removes any old syntax stuff hanging around
  7. syn clear
  8.  
  9. " Metafont 'primitives' as defined in chapter 25 of 'The METAFONTbook'
  10. " Page 210: 'boolean expressions'
  11. syn keyword mfBoolExp true false known unknown odd charexists not and or
  12.  
  13. " Page 210: 'numeric expression'
  14. syn keyword mfNumExp normaldeviate length ASCII oct hex angle turningnumber
  15. syn keyword mfNumExp totalweight directiontime xpart ypart xxpart xypart
  16. syn keyword mfNumExp yxpart yypart sqrt sind cosd mlog mexp floor
  17. syn keyword mfNumExp uniformdeviate
  18.  
  19. " Page 211: 'internal quantities'
  20. syn keyword mfInternal tracingtitles tracingequations tracingcapsules
  21. syn keyword mfInternal tracingchoices tracingspecs tracingpens
  22. syn keyword mfInternal tracingcommands tracingrestores tracingmacros
  23. syn keyword mfInternal tracingedges tracingoutput tracingonline tracingstats
  24. syn keyword mfInternal pausing showstopping fontmaking proofing
  25. syn keyword mfInternal turningcheck warningcheck smoothing autorounding
  26. syn keyword mfInternal granularity fillin year month day time
  27. syn keyword mfInternal charcode charext charwd charht chardp charic
  28. syn keyword mfInternal chardx chardy designsize hppp vppp xoffset yoffset
  29. syn keyword mfInternal boundarychar
  30.  
  31. " Page 212: 'pair expressions'
  32. syn keyword mfPairExp point of precontrol postcontrol penoffset rotated
  33. syn keyword mfPairExp scaled shifted slanted transformed xscaled yscaled
  34. syn keyword mfPairExp zscaled
  35.  
  36. " Page 213: 'path expressions'
  37. syn keyword mfPathExp makepath reverse subpath curl tension atleast
  38. syn keyword mfPathExp controls cycle
  39.  
  40. " Page 214: 'pen expressions'
  41. syn keyword mfPenExp nullpen pencircle makepen
  42.  
  43. " Page 214: 'picutre expressions'
  44. syn keyword mfPicExp nullpicture
  45.  
  46. " Page 214: 'string expressions'
  47. syn keyword mfStringExp jobname readstring str char decimal substring
  48.  
  49. " Page 217: 'commands and statements'
  50. syn keyword mfCommand end dump save interim newinternal randomseed let
  51. syn keyword mfCommand delimiters outer everyjob show showvariable showtoken
  52. syn keyword mfCommand showdependencies showstats message errmessage errhelp
  53. syn keyword mfCommand batchmode nonstopmode scrollmode errorstopmode
  54. syn keyword mfCommand addto also contour doublepath withpen withweight cull
  55. syn keyword mfCommand keeping dropping display inwindow openwindow at from to
  56. syn keyword mfCommand shipout special numspecial
  57.  
  58. " Page 56: 'types'
  59. syn keyword mfType boolean numeric pair path pen picture string transform
  60.  
  61. " Page 155: 'grouping'
  62. syn keyword mfStatement begingroup endgroup
  63.  
  64. " Page 165: 'definitions'
  65. syn keyword mfDefinition enddef def expr suffix text primary secondary
  66. syn keyword mfDefinition tertiary vardef primarydef secondarydef tertiarydef
  67.  
  68. " Page 169: 'conditions and loops'
  69. syn keyword mfCondition if fi else elseif endfor for forsuffixes forever
  70. syn keyword mfCondition step until exitif
  71.  
  72. " Other primitives listed in the index
  73. syn keyword mfPrimitive charlist endinput expandafter extensible 
  74. syn keyword mfPrimitive fontdimen headerbyte inner input intersectiontimes 
  75. syn keyword mfPrimitive kern ligtable quote scantokens skipto
  76.  
  77. " Keywords defined by plain.mf (defined on pp.262-278)
  78. if !exists("plain_mf_macros")
  79.   let plain_mf_macros = 1 " Set this to '0' if your source gets too colourful
  80.                           " metapost.vim does so to turn off Metafont macros
  81. endif
  82. if plain_mf_macros
  83.   syn keyword mfMacro abs addto_currentpicture aspect_ratio base_name
  84.   syn keyword mfMacro base_version beginchar blacker blankpicture bot bye byte
  85.   syn keyword mfMacro capsule_def ceiling change_width clear_pen_memory clearit
  86.   syn keyword mfMacro clearpen clearxy counterclockwise culldraw cullit
  87.   syn keyword mfMacro currentpen currentpen_path currentpicture
  88.   syn keyword mfMacro currenttransform currentwindow cutdraw cutoff d decr
  89.   syn keyword mfMacro define_blacker_pixels define_corrected_pixels
  90.   syn keyword mfMacro define_good_x_pixels define_good_y_pixels
  91.   syn keyword mfMacro define_horizontal_corrected_pixels define_pixels
  92.   syn keyword mfMacro define_whole_blacker_pixels define_whole_pixels
  93.   syn keyword mfMacro define_whole_vertical_blacker_pixels
  94.   syn keyword mfMacro define_whole_vertical_pixels dir direction directionpoint
  95.   syn keyword mfMacro displaying ditto div dotprod down downto draw drawdot
  96.   syn keyword mfMacro endchar eps epsilon extra_beginchar extra_endchar
  97.   syn keyword mfMacro extra_setup erase exitunless fill filldraw fix_units flex
  98.   syn keyword mfMacro font_coding_scheme font_extra_space font_identifier
  99.   syn keyword mfMacro font_normal_shrink font_normal_space font_normal_stretch
  100.   syn keyword mfMacro font_quad font_setup font_size font_slant font_x_height
  101.   syn keyword mfMacro fullcircle generate gfcorners gobble gobbled grayfont h
  102.   syn keyword mfMacro halfcircle hide hround identity image_rules incr infinity
  103.   syn keyword mfMacro interact interpath intersectionpoint inverse italcorr
  104.   syn keyword mfMacro join_radius killtext labelfont labels left lft localfont
  105.   syn keyword mfMacro loggingall lowres lowres_fix mag magstep makebox makegrid
  106.   syn keyword mfMacro makelabel maketicks max min mod mode mode_def mode_name
  107.   syn keyword mfMacro mode_setup nodisplays notransforms number_of_modes numtok
  108.   syn keyword mfMacro o_correction openit origin pen_bot pen_lft pen_rt pen_top
  109.   syn keyword mfMacro penlabels penpos penrazor penspeck pensquare penstroke
  110.   syn keyword mfMacro pickup pixels_per_inch proof proofoffset proofrule
  111.   syn keyword mfMacro proofrulethickness quartercircle range reflectedabout
  112.   syn keyword mfMacro relax right rotatedabout rotatedaround round rt rulepen
  113.   syn keyword mfMacro savepen screenchars screen_rows screen_cols screenrule
  114.   syn keyword mfMacro screenstrokes shipit showit slantfont smode smoke softjoin
  115.   syn keyword mfMacro solve stop superellipse takepower tensepath titlefont
  116.   syn keyword mfMacro tolerance top tracingall tracingnone undraw undrawdot
  117.   syn keyword mfMacro unfill unfilldraw unitpixel unitsquare unitvector up upto
  118.   syn keyword mfMacro vround w whatever
  119. endif
  120.  
  121. " Some other basic macro names, e.g., from cmbase, logo, etc.
  122. if !exists("other_mf_macros")
  123.   let other_mf_macros = 1 " Set this to '0' if your code gets too colourful
  124.                           " metapost.vim does so to turn off Metafont macros
  125. endif
  126. if other_mf_macros
  127.   syn keyword mfMacro beginlogochar
  128. endif
  129.  
  130. " Numeric tokens
  131. syn match mfNumeric    "[-]\=\d\+"
  132. syn match mfNumeric    "[-]\=\.\d\+"
  133. syn match mfNumeric    "[-]\=\d\+\.\d\+"
  134.  
  135. " Metafont lengths
  136. syn match mfLength    "\<\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\>"
  137. syn match mfLength    "\<[-]\=\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\=\>"
  138. syn match mfLength    "\<[-]\=\.\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\=\>"
  139. syn match mfLength    "\<[-]\=\d\+\.\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\=\>"
  140.  
  141. " Metafont coordinates and points
  142. syn match mfCoord    "\<[xy]\d\+\>"
  143. syn match mfPoint    "\<z\d\+\>"
  144.  
  145. " String constants
  146. syn region mfString    start=+"+ end=+"+
  147.  
  148. " Comments:
  149. syn match mfComment    "%.*$"
  150.  
  151. " synchronizing
  152. syn sync maxlines=50
  153.  
  154. if !exists("did_mf_syntax_inits")
  155.   let did_mf_syntax_inits = 1
  156.   " The default methods for highlighting. Can be overridden later
  157.   hi link mfBoolExp    Statement
  158.   hi link mfNumExp    Statement
  159.   hi link mfInternal    Identifier
  160.   hi link mfPairExp    Statement
  161.   hi link mfPathExp    Statement
  162.   hi link mfPenExp    Statement
  163.   hi link mfPicExp    Statement
  164.   hi link mfStringExp    Statement
  165.   hi link mfCommand    Statement
  166.   hi link mfType    Type
  167.   hi link mfStatement    Statement
  168.   hi link mfDefinition    Statement
  169.   hi link mfCondition    Conditional
  170.   hi link mfPrimitive    Statement
  171.   hi link mfMacro    Macro
  172.   hi link mfCoord    Identifier
  173.   hi link mfPoint    Identifier
  174.   hi link mfNumeric    Number
  175.   hi link mfLength    Number
  176.   hi link mfComment    Comment
  177.   hi link mfString    String
  178. endif
  179.  
  180. let b:current_syntax = "mf"
  181.  
  182. " vim: ts=8
  183.